package model.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name="evento")
public class Evento {

	@Id
	@GeneratedValue
	@Column(name="id_evento")
	private Long eventoId;
	
	@Temporal(value= TemporalType.TIMESTAMP)
	private Date data;
	
	@Column(name="descricao")
	private String descricao;
	
	@ManyToMany
	@JoinTable(name= "evento_participante" , 
	joinColumns = {@JoinColumn(name = "id_evento")} , 
	inverseJoinColumns= {@JoinColumn(name="id_participante")})
	private ArrayList<Participante> participantes =  new ArrayList<Participante>();

	@ManyToMany
	@JoinTable(name= "evento_ambiente" , 
	joinColumns = {@JoinColumn(name = "id_evento")} , 
	inverseJoinColumns= {@JoinColumn(name="id_ambiente")})
	private ArrayList<Ambiente> ambientes = new ArrayList<Ambiente>();

	
	public Long getEventoId() {
		return eventoId;
	}

	public void setEventoId(Long eventoId) {
		this.eventoId = eventoId;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public ArrayList<Participante> getParticipantes() {
		return participantes;
	}

	public void setParticipantes(ArrayList<Participante> participantes) {
		this.participantes = participantes;
	}

	public ArrayList<Ambiente> getAmbientes() {
		return ambientes;
	}

	public void setAmbientes(ArrayList<Ambiente> ambientes) {
		this.ambientes = ambientes;
	}




	
}
